package com.fusetech.flow.audit.service.mapstruct;


import com.fusetech.flow.audit.domain.AuditProcess;
import com.fusetech.flow.audit.service.dto.AuditProcessDTO;
import com.fusetech.os.core.mapstruct.EntityWrapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 *  AuditProcessWrapper
 * @author admin
 * @version 2023-05-06
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
public interface AuditProcessWrapper extends EntityWrapper<AuditProcessDTO, AuditProcess> {

    AuditProcessWrapper INSTANCE = Mappers.getMapper(AuditProcessWrapper.class);
     @Mappings({
            @Mapping(source = "formId", target = "formId"),
            @Mapping(source = "createBy.userId", target = "createBy"),
            @Mapping (source = "updateBy.userId", target = "updateBy")
     })
    AuditProcess toEntity(AuditProcessDTO dto);


    @Mappings({
            @Mapping(source = "formId", target = "formId"),
            @Mapping (source = "createBy", target = "createBy.userId"),
            @Mapping (source = "updateBy", target = "updateBy.userId")
    })
    AuditProcessDTO toDTO(AuditProcess entity);
}

